//
//  ScrollViews.swift
//  SwiftUI-CTao
//
//  Created by 涛 on 2019/9/17.
//  Copyright © 2019 涛. All rights reserved.
//

import SwiftUI

struct ScrollViews: View {
    var body: some View {
        
        VStack {
            ScrollView(.horizontal, showsIndicators: true) {
                
                HStack {
                    Image("1")
                    .resizable()
                    .frame(width: 80, height: 80)


                    Image("2")
                    .resizable()
                    .frame(width: 80, height: 80)


                    Image("3")
                    .resizable()
                    .frame(width: 80, height: 80)


                    Image("4")
                    .resizable()
                    .frame(width: 80, height: 80)


                    Image("5")
                    .resizable()
                    .frame(width: 80, height: 80)
                }
            }
            
            ScrollView(.vertical, showsIndicators: true) {
                
                VStack {
                    Image("6")
                    .resizable()
                    .frame(width: 120, height: 120)


                    Image("7")
                    .resizable()
                    .frame(width: 120, height: 120)


                    Image("8")
                    .resizable()
                    .frame(width: 120, height: 120)


                    Image("9")
                    .resizable()
                    .frame(width: 120, height: 120)


                    Image("10")
                    .resizable()
                    .frame(width: 120, height: 120)
                }
            }
        }
    }
}

struct ScrollViews_Previews: PreviewProvider {
    static var previews: some View {
        ScrollViews()
    }
}
